<script setup lang="ts">
import { ref } from 'vue'
import { useData } from 'vitepress'

const defaultAuthor = '唐亚峰 | battcn'
const { frontmatter } = useData()

const author = ref(defaultAuthor)

if (frontmatter.value?.author)
  author.value = frontmatter.value?.author

const pageHref = location.href
</script>

<template>
  <div class="px-[1.2rem] relative py-[1rem] border-1 border-[var(--vp-c-border)]/[.55] w-full min-h-[32px] border-solid mt-[32px] leading-[24px] rounded-[4px]">
    <fa6-solid:copyright class="absolute top-[1rem] right-[1.2rem] " />
    <section class="flex flex-col gap-y-[8px] overflow-hidden">
      <div>
        <span class="font-bold">作者：</span>
        <span>
          <a href="https://gitee.com/battcn/wemirr-platform" rel="noreferrer" target="_blank">
            {{ author }}
          </a>
        </span>
      </div>
      <div>
        <span class="font-bold">链接：</span>
        <span>
          <a :href="pageHref" rel="noreferrer" target="_blank">
            {{ pageHref }}
          </a>
        </span>
      </div>
    </section>
  </div>
</template>
